#!/bin/bash
clear
echo 'Updating your LIVE Liriope site from you test site...'
echo '-----------------------------------------------------'
echo
echo You can first sync with a DRY RUN [recommended]
echo Would you like to do this? [Yn]

read -sn 1 dryrun

echo
echo 'Please enter your ssh password when prompted:'

if [ "$dryrun" = "n" ] || [ "$dryrun" = "N" ]; then

    echo THIS IS THE REAL THING
    rsync --delete --include-from rsync-include.txt --exclude=* -avze 'ssh -p 1291' ./ northroc@northrockhill.com:public_html/

else

    echo This is a DRY RUN
    rsync --delete --include-from rsync-include.txt --exclude=* -avzne 'ssh -p 1291' ./ northroc@northrockhill.com:public_html/

    wait $!

    echo
    echo "Would you like to deploy to production? [yN]"
    read -sn 1 dolive
    if [ "$dolive" = "y" ] || [ "$dolive" = "Y" ]; then

        echo THIS IS THE REAL THING
        rsync --delete --include-from rsync-include.txt --exclude=* -avze 'ssh -p 1291' ./ northroc@northrockhill.com:public_html/

    fi

fi

echo
echo "    _    _ _   ____                   _ "
echo "   / \  | | | |  _ \  ___  _ __   ___| |"
echo "  / _ \ | | | | | | |/ _ \| '_ \ / _ \ |"
echo " / ___ \| | | | |_| | (_) | | | |  __/_|"
echo "/_/   \_\_|_| |____/ \___/|_| |_|\___(_)"
echo Back to you...
echo

